package com.sk.restree.model.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.sk.restree.model.dao.CardDAO;
import com.sk.restree.model.dao.MemberDAO;
import com.sk.restree.model.dto.MemberDTO;

public class CardSelectAction implements Action {

	@Override
	public Object execute(HttpServletRequest request,
			HttpServletResponse response) {
		
		HttpSession session = request.getSession();
		MemberDTO dto = (MemberDTO)session.getAttribute("userinfo");
		String cname = request.getParameter("cname");
		
		MemberDTO rdto = (MemberDTO) CardDAO.getInstance().modifycard(dto, cname);
		session = request.getSession();
		session.setAttribute("userinfo", rdto);
		return rdto; 
	}

}
